package activity

import androidx.activity.viewModels
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import apdate.ZhuanApdate
import com.wd.common.base.BaseActivity
import com.wd.common.viewmodel.MyViewModel
import com.wd.rim.databinding.ActivityZhuanBinding

class ZhuanActivity : BaseActivity<ActivityZhuanBinding, Any?>() {
   private val viewmodel: MyViewModel by viewModels()
    private var apdate:ZhuanApdate?=null
    override fun getViewBinding()=ActivityZhuanBinding.inflate(layoutInflater)

    override fun initData() {
       viewmodel.getZhuan()
        viewmodel.RimZhuan.observe(this, Observer {
                apdate=this.let {it1->ZhuanApdate(it1,it.result)  }
            binding.recyId.layoutManager=LinearLayoutManager(this)
            binding.recyId.adapter=apdate
        })

    }
}